import {axiosClient,HttpPromise} from '../../utils/axiosClient';
import { BannerResp, HotActivityResp, HotNewsResp, NewsListResp } from '../bean/apiTypes';
import { RecommendResp } from '../bean/Recommend';


// 获取广告api接口
export const getAdvertisements = (pageSize:number,preOperatorId:number): HttpPromise<BannerResp> => axiosClient.post({url:'/operator/queryAdvertisements',data:{pageSize:pageSize,preOperatorId:preOperatorId}});

// 获取资讯信息
export const getInfoNews = (pageNum:number,pageSize:number): HttpPromise<HotNewsResp> => axiosClient.post({url:'/information/page',data:{pageSize:pageSize,pageNum:pageNum,queryColumn:1,keyWord:''}});

// 获取热门活动
export const getActivityList = (): HttpPromise<HotActivityResp> => axiosClient.get({url:'/activity/list'});

// 获取推荐列表
export const getRecommendList = (num:number,size:number): HttpPromise<RecommendResp> => axiosClient.get({url:'/information/recommend_list',params:{num:num,size:size}});

// 获取最新列表
export const getNewsList = (pageNum:number,pageSize:number): HttpPromise<NewsListResp> => axiosClient.post({url:'/information/home_info_list',data:{pageSize:pageSize,pageNum:pageNum}});